/**
 * Vec.h
 * Coyright (c) 2009 Xiaofeng Gu. All Rights Reserved.
 * Author : Xiaofeng Gu
 *
 * Creation Data : 2009/06/11
 */

#pragma once

class CVec
{
public:
	CVec();
	CVec(double x1, double y1, double z1);
	virtual ~CVec();

// operator
	double			operator[](unsigned int i) const;
	CVec&			operator=(const CVec& Vec);
	double			operator*(const CVec& Vec);
	CVec			operator*(double K);
	void			operator*=(double K);
	CVec			operator-(const CVec& Vec);
	CVec			operator+(const CVec& Vec);
	CVec			operator^(const CVec& Vec);
	bool			operator==(const CVec& Vec);

// method
	double			Length();
	void			RotateBy(const CVec& RefV, double Angle);
	void			Identify();
	double			CrossAngle(CVec& vec);
	void			XVector();
	void			YVector();
	void			ZVector();
	void			Zero();
	bool			Equal(double x1, double y1, double z1);
	void			SetX(double value) { x = value; }
	void			SetY(double value) { y = value; }
	void			SetZ(double value) { z = value; }

private:
	double			x, y, z;
};